// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/base/api/EmergencyPlanApi'

import EditClass from '@api/base/model/EmergencyPlanSendReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 修改 —————————————————————————————— //

  transEdit(one, { state: { param: { idList } }, rootState: { one: { id } } }) {
    return { planId: id, groupId: idList.join() }
  },
  async edit(one, TIP = '预案发送') {
    const DTO = CORE.grpcDTO(EditClass, one)
    await CORE.grpc(TIP, CLIENT, 'emergencyPlanSend', DTO)
    return CORE.grpcOK(TIP)
  },
}
